﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Nature.Text
{
    public delegate void TextInfoEventHandler(object sender, TextInfoEventArgs ergs);

    public interface ITextInfoEventListener
    {
        void Submit(TextInfoEventArgs args);
    }

    [DebuggerDisplay("{Message}")]
    public class TextInfoEventArgs : EventArgs
    {
        public TextInfoEventArgs(TextInfoType infoType, string message, TextFragment fragment)
        {
            InfoType = infoType;
            Message = message;
            Fragment = fragment;
            if (Message == null || Fragment == null)
            {
                throw new ArgumentNullException();
            }
        }

        public TextInfoType InfoType { get; private set; }

        public string Message { get; private set; }

        public TextFragment Fragment { get; private set; }
    }


    public enum TextInfoType
    {
        Information,
        Warning,
        Error
    }
}
